import axios from "axios"

const API_URL = "http://localhost:8080/app/comment"

// 查询所有评价
export const getAllComments = (pageNum,userId) => {
    if (pageNum ==null || pageNum == undefined) {
        pageNum = 1;
    }
    return axios.get(`${API_URL}/page/${pageNum}/${userId}`);
}
// 添加评价
export const saveComment = (comment)=>{
    return axios.post(`${API_URL}`,comment)
}
// 删除评价
export const deleteComment = (commentId,userId) => {
    return axios.delete(`${API_URL}/${commentId}/${userId}`)
}






